<html jwcid="@Border" pageHeader="webbeans:BeanEditor Component Demo">

	<a class="navigation_link" href="#" jwcid="@DirectLink" listener="listener:showBlock" parameters="plainJavaBeanDemo">Show PlainJavaBean Demo</a>
	<a class="navigation_link" href="#" jwcid="@DirectLink" listener="listener:showBlock" parameters="complexJavaBeanDemo">Show ComplexJavaBean Demo</a>
	
	<span jwcid="@RenderBlock" block="ognl:activeBlock"></span>
	
	<div jwcid="plainJavaBeanDemo@Block">
	<h2>Using <code>webbeans:BeanEditor</code> with plain JavaBeans</h2>
	
	<h3>Sample Plain JavaBean Object</h3>
	<pre>
	public class PlainJavaBean {
	
	    private BigDecimal bigDecimal;
	    private boolean bool;
	    private Date date;
	    private int integer;
	    private List&lt;String&gt; listOfStrings;
	    private String string;
	    private MyEnum myEnum;
	    private double dbl;
    	    
	    //	getters/setters
	    
	}
	
	public enum MyEnum {
	    Enum1,
	    Enum2,
	    Enum3
	}
	</pre>

    <h3>Component Usecases for <code>webbeans:BeanEditor</code></h3>
    
    <h4>Using <code>webbeans:BeanEditor</code> to edit JavaBean object</h4>
    
    <table width="100%">
        <tbody>
            <tr>
                <td>
<pre> &lt;form jwcid="@Form"&gt;
   &lt;span jwcid="@webbeans:BeanEditor" 
            <b>bean="ognl:plainJavaBean"</b> /&gt;
            
   &lt;input type="reset" /&gt;
   &lt;input jwcid="@Submit" /&gt;
 &lt;/form&gt;</pre>
                </td>
                <td>
                    <form jwcid="@Form">
                        <span jwcid="@webbeans:BeanEditor" bean="ognl:plainJavaBean"/>
                        <input type="reset" />
                        <input jwcid="@Submit" />
                    </form>
                </td>
            </tr>
        </tbody>
    </table>

    <h4>Using <code>readOnly</code> mode to view bean state</h4>
    
    <table width="100%">
        <tbody>
            <tr>
                <td>
<pre> &lt;span jwcid="@webbeans:BeanEditor" 
   bean="ognl:personBean" 
   <b>readOnly="true"</b> /&gt;</pre>
                  </td>
                <td>
                    <span jwcid="@webbeans:BeanEditor" bean="ognl:plainJavaBean" readOnly="true" />
                </td>
            </tr>
        </tbody>
    </table>
	</div>

	<div jwcid="complexJavaBeanDemo@Block">
	<h2>Using <code>webbeans:BeanEditor</code> with complex JavaBeans</h2>
	
	<h3>Sample Complex JavaBean Object</h3>
	<pre>
	public class ComplexJavaBean {
	
	    private boolean bool;
	    private List&lt;PlainJavaBean&gt; plainJavaBeans;
	    private List&lt;Date&gt; listOfDates;
	    private ComplexJavaBean complexJavaBean;
    
    	    //	getters/setters
	    
	}
	</pre>

    <h3>Component Usecases for <code>webbeans:BeanEditor</code></h3>
    
    <h4>Using <code>webbeans:BeanEditor</code> to edit JavaBean object</h4>
    
    <table width="100%">
        <tbody>
            <tr>
                <td>
<pre> &lt;form jwcid="@Form"&gt;
   &lt;span jwcid="@webbeans:BeanEditor" 
            <b>bean="ognl:complexJavaBean"</b> /&gt;
            
   &lt;input type="reset" /&gt;
   &lt;input jwcid="@Submit" /&gt;
 &lt;/form&gt;</pre>
                </td>
                <td>
                    <form jwcid="@Form">
                        <span jwcid="@webbeans:BeanEditor" bean="ognl:complexJavaBean"/>
                        <input type="reset" />
                        <input jwcid="@Submit" />
                    </form>
                </td>
            </tr>
        </tbody>
    </table>

    <h4>Using <code>readOnly</code> mode to view bean state</h4>
    
    <table width="100%">
        <tbody>
            <tr>
                <td>
<pre> &lt;span jwcid="@webbeans:BeanEditor" 
   bean="ognl:complexJavaBean" 
   <b>readOnly="true"</b> /&gt;</pre>
                  </td>
                <td>
                    <span jwcid="@webbeans:BeanEditor" bean="ognl:complexJavaBean" readOnly="true" />
                </td>
            </tr>
        </tbody>
    </table>
	</div>
    
</html>